{extend name="public/layer_base"}
{block name="main"}
<div class="layui-body layui-tab-content site-demo site-demo-body">
    <div class="layui-tab-item layui-show">
        <div class="layui-main">
            <div id="LAY_preview">
                <form class="layui-form" action="{:url('save_api')}" id="send_form" method="post">
                    <div class="layui-form-item">
                        <label class="layui-form-label">接口名称</label>
                        <div class="layui-input-block">
                            <input type="text" name="name" lay-verify="required" autocomplete="off" placeholder="请输入接口名称" class="layui-input" value="{$data.name|default=''}">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">接口api</label>
                        <div class="layui-input-block">
                            <input type="text" name="api" lay-verify="required" autocomplete="off" placeholder="请输入接口api" class="layui-input" value="{$data.api|default=''}">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">选择分类</label>
                            <div class="layui-input-inline">
                                <select name="cid" lay-filter="pid">
                                    <option value="">请选择分类</option>
                                    {volist name="category" id="vo"}
                                    <optgroup label="{$vo.name}">
                                        {volist name="vo.childrens" id="v"}
                                        <option value="{$v.id}" {eq name="v.id" value="$data.cid|default=0"}selected{/eq}>{$v.name}</option>
                                        {/volist}
                                    </optgroup>
                                    {/volist}
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <input type="hidden" name="id" value="{$data.id|default=0}">
                            <button class="layui-btn" lay-submit="" lay-filter="send_form">立即提交</button>
                            <!--<button class="layui-btn" type="submit">立即提交</button>-->
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
{/block}

{block name="javascript"}
{/block}